<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="renderer" content="webkit">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>风险保证金信息</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
<div class="Wrapper">
<div id="pageInTab" class="pageInTab">
	 <form id="prj_prd_pay_rick_dep_form">
                        <div class="fieldset1 tabel_col clearFix">
                                <div class="fieldBox col_50">
				                    <div class="field" style="color: red">条件提醒</div>
		               		 </div>
		               		     <div class="fieldBox col_50">
				                    <div class="field" style="color: red">${payStsCd}</div>
		               		   </div>
		               		         <div class="fieldBox col_50">
				                    <div class="label">承租人名称</div>
				                    <div class="field">
				                          <span>${prjBscInfoVO.cstNm }</span>
				                    </div>
		               		 </div>
                        
		               		 <div class="fieldBox col_50">
				                    <div class="label">租赁合同号</div>
				                    <div class="field">
				                          <span>${prjBscInfoVO.lsCntNo }</span>
				                    </div>
		               		 </div>
		               		 <div class="fieldBox col_50">
				                    <div class="label">支付表号</div>
				                    <div class="field">
				                          <span>${prdPaySchMVO.paySchNo }</span>
				                    </div>
		               		 </div>
                        	 <div class="caption">
                                <span class="title">风险保证金</span>
                    </div>
		               		  <div class="fieldBox col_100_auto">
				                    <div class="label">费用金额</div>
				                    <div class="field">
				                          <span>${prdPaySchDVO.feeAmt }</span>
				                    </div>
		               		 </div>
		               	 <%-- <div class="fieldBox col_100_auto">
				                    <div class="label">应收时间</div>
				                    <div class="field">
				                          <span id="payDt">${prdPaySchDVO.payDt }</span>
				                    </div>
		               		 </div> --%>
		               	   <div class="fieldBox col_100">
				                    <div class="label"> 备注</div>
				                    <div class="field">
				                    ${prdPaySchDVO.feeRem}
				                    </div>
		               		 </div>
		               		   <div class="fieldset1 tabel_col tabel_col_s clearFix noBorder">
	                            <div class="caption">
	                                <span class="title">上传附件信息 </span>
	                            </div>
			           	 <div class="fieldBox col_100" id="fileDetail">
			                    <div class="label">资料上传</div>
			                    <div class="field">
			                    	<jsp:include page="../../system/sysUlFilesRec/sysUlFileRecListDetail.jsp" flush="true" >
			                    		<jsp:param name="pkId" value="${prdPaySchDVO .id}"/>
				                    		<jsp:param name="tabNm" value="PRJ_PRD_PAY_SCH_D"/>
			                    	</jsp:include>
			                    </div>
			               </div>
	               </div>
                </div>
               </form>
             </div>
	          <div class="fieldBox col_100" id="psnDiv">
	              <div class="sqPanel">
	                  <div class="sqPanel_head inL">
	                      <div class="btnsBox inLC">
	                          <span id="addBtn" class="sq-button sq-button-round">新增</span>
	                      </div>
	                      <span>补充信息栏</span>
	                      </br>
	                      </br>
	                      <div id="rejectPageList" class="sq-grid"></div>
	                  </div>
	              </div>
	         </div>
        </div>
	<script>
		$(function() {
			 var ligerForm = liger.get("prj_prd_pay_rick_dep_form");
		   $("#prj_prd_pay_rick_dep_form").ligerForm({
                validate: true
           });
		
		var prjPaySchFeeId = ${prjPaySchFeeId};
		//初始化补充信息表
        grid = $("#rejectPageList").ligerGrid({
            url: '<%=path%>/project/prjprdpayschm/rejectPageInitList.do?prjPaySchFeeId=' + prjPaySchFeeId,
            method: 'get',
            columns: [
				{display: '补充金额', name: 'supplementAmt', minWidth: 100, align: 'left',
					render:function(rowdata,index,value){
                        return '&yen;'+FormatMoney(rowdata.supplementAmt/100);
                    }	
				},
				{display: '补充时间', name: 'supplementDt', minWidth: 100, align: 'center', enabledSort: false,render:renderDate},
				{display: '备注', name : 'supplementRem', minWidth: 100, align: 'left'},
				{display: '附件', isSort: false,minWidth: 100, align: 'left',
					render: function (rowdata, rowindex, value){
	                	  var h="";
	                        h='<a class="sq-button-hasicon" href="javascript:selectByattachment(';
	                        h+="'"+rowdata.id+"'";
	                        h+=')">查询附件</a>';
	                    return h;
	                }
				},
				{
	                display: '操作',
	                isSort: false,
	                width: 150,
	                align:'left',
	                render: function (rowdata, rowindex, value){
	                	  var h="";
	                        h='<a class="sq-button-hasicon" href="javascript:modifyBtn(';
	                        h+="'"+rowdata.id+"'";
	                        h+=')"><i class="sqBtnIco_4"></i>修改</a>';
	                        
	                        h+='<a class="sq-button-hasicon" href="javascript:removeBtn(';
	                        h+="'"+rowdata.id+"'";
	                        h+=')"><i class="sqBtnIco_7"></i>删除</a>';
	                    return h;
	                }
	            } 
            ],
            pageSize: 100,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            heightDiff: -2,
            checkbox: false,
            enabledEdit: true,
            allowUnSelectRow: true,
            alternatingRow: false,
            rownumbers: true,
            enabledSort: false,
            usePagerOnLessPagesize: false
        });
        grid.setHeight(200);
        
        //格式化时间
        function renderDate(rowdata, index, value) {
            var dateStr = "";
            if (null != value) {
                var date = new Date(value);
                dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
            }
            return dateStr;
        }
        
		/* 新增 */
        $("#addBtn").click(function (event) {
            $.ligerDialog.SQopen({
                width: 550,
                height: 350,
                title: '新增补充信息',
                url: '<%=path%>/project/prjprdpayschm/toRejectAddandAlterPage.do?prjPaySchFeeId=' + prjPaySchFeeId
            	});
        	});
		});
		 //修改
    	function modifyBtn(id){
    		$.ligerDialog.SQopen({
                width: 550,
                height: 350,
                title: '修改补充信息',
                url: '<%=path%>/project/prjprdpayschm/toRejectAddandAlterPage.do?id=' + id
            	});
    		
    	}
    	//查询附件
    	function selectByattachment(id){
    		$.ligerDialog.SQopen({
                width: 550,
                height: 350,
                title: '附件信息',
                url: '<%=path%>/project/prjprdpayschm/toselectByattachment.do?id=' + id,
            	});
    		
    	}
		//删除所选上牌信息
		function removeBtn(id){
			$.ligerDialog.confirm(LogUtils.LOG_CMM_DELETE_CONFIRM, function (flag) {
				if(flag == false)return;
				$.ajax({
					type: 'post',
					dataType:'json',
					data:{id:JSON.stringify(id)},
					url: '<%=path%>/project/prjprdpayschm/rejectRemoveById.do?id=' + id,
					success:function(msg){
						 if(msg.success == 1){
							 grid.reload();
						 }else{
							 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
						 }
					}
				});
			});
			
		}
	</script>
</body>
</html>